<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:import url="/jsp/pager/pagerForm.jsp"></c:import>

<form method="post" rel="pagerForm" action="<c:url value='/delivery/showList'/>" onsubmit="return navTabSearch(this)">
	<div class="pageHeader">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td><label>关键词：</label> <input type="text" name="keywords" value="${param.keywords}" /></td>
				</tr>
				<tr>
					<td><label>业务员：</label> <input name="salesman" type="text" value="${param.salesman}" suggestFields="salesman"
						suggestUrl="<c:url value='/showSalesmanSuggest' />" lookupGroup="" /></td>
					<td><label>技术员：</label> <input name="technician" type="text" value="${param.technician}"
						suggestFields="technician" suggestUrl="<c:url value='/showTechnicianSuggest' />" lookupGroup="" /></td>
					<td><label>司机：</label> <input name="driver" type="text" value="${param.driver}" suggestFields="driver"
						suggestUrl="<c:url value='/showDriverSuggest' />" lookupGroup="" /></td>
				</tr>
				<tr>
					<td><label>所属月份：</label> <input name="abstractMonth" class="date" type="text" value="${param.abstractMonth}"
						readonly=" true" dateFmt="yyyy-M" /></td>
					<td><label>送货方式：</label> <select name="deliveryMethod" class="combox">
							<option value="">请选择</option>
							<c:forEach var="item" items="${deliveryMethodList}">
								<option value="${item.method}" ${item.method eq param.deliveryMethod ? 'selected="selected"' : ''}>${item.method}</option>
							</c:forEach>
					</select></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">搜索</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</form>

<div class="pageContent">

	<div class="panelBar">
		<ul class="toolBar">
			<c:if test="${sessionInfo.role == '管理员' || sessionInfo.role == '财务' || sessionInfo.role == '技术员'}">
				<li><a class="add" target="dialog" width="530" height="600" rel="deliveryAdd" mask="true"
					href="<c:url value='/delivery/showAdd'/>" title="添加送货"><span>添加</span></a></li>
			</c:if>
			<c:if test="${sessionInfo.role == '管理员' || sessionInfo.role == '财务' || sessionInfo.role == '商务'}">
				<li><a class="edit" target="dialog" width="530" height="600" rel="deliveryEdit" mask="true"
					href="<c:url value='/delivery/showEdit/{slt_objId}'/>" title="编辑送货"><span>编辑</span></a></li>
			</c:if>
			<c:if test="${sessionInfo.role == '管理员' || sessionInfo.role == '财务'}">
				<li><a class="delete" target="ajaxTodo" href="<c:url value='/delivery/delete/{slt_objId}'/>" title="你确定要删除吗?"><span>删除</span></a></li>
			</c:if>
			<%--<c:if test="${sessionInfo.role == '管理员' || sessionInfo.role == '财务' || sessionInfo.role == '业务员'}">--%>
				<%--<li><a class="icon" target="ajaxTodo" href="<c:url value='/delivery/audit/{slt_objId}'/>" title="你确定要审核通过吗?"><span>审核</span></a></li>--%>
			<%--</c:if>--%>
			<li class="line">line</li>
			<li><a class="icon" href="javascript:$.printBox('delivery_list_print')"><span>打印</span></a></li>
		</ul>
	</div>

	<div id="delivery_list_print">
		<table class="list" width="1500" asc="asc" desc="desc" layoutH="166">
			<thead>
				<tr>
					<th width="3%">合计</th>
					<th width="97%" colspan="17"><c:if test="${sessionInfo.role != '商务'}">技术提成：${total.bonus}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</c:if>送货花费：${total.cost}</th>
				</tr>
				<tr>
					<th width="3%">序号</th>
					<th width="5%" orderField="orderNo" class="${pageHelper.orderField eq 'orderNo' ? param.orderDirection : ''}">订单号</th>
					<th width="5%" orderField="orderDate" class="${pageHelper.orderField eq 'orderDate' ? param.orderDirection : ''}">时间</th>
					<th width="5%" orderField="salesman" class="${pageHelper.orderField eq 'salesman' ? param.orderDirection : ''}">业务员</th>
					<th width="17%" orderField="customer" class="${pageHelper.orderField eq 'customer' ? param.orderDirection : ''}">客户名称</th>
					<th width="10%" orderField="product" class="${pageHelper.orderField eq 'product' ? param.orderDirection : ''}">产品明细</th>
					<th width="5%" orderField="deliveryMethod"
						class="${pageHelper.orderField eq 'deliveryMethod' ? param.orderDirection : ''}">送货方式</th>
					<th width="5%" orderField="deliveryDate"
						class="${pageHelper.orderField eq 'deliveryDate' ? param.orderDirection : ''}">送货日期</th>
					<th width="3%" orderField="technician" class="${pageHelper.orderField eq 'technician' ? param.orderDirection : ''}">技术员</th>
					<th width="5%" orderField="departTime" class="${pageHelper.orderField eq 'departTime' ? param.orderDirection : ''}">出发时间</th>
					<th width="5%" orderField="returnTime" class="${pageHelper.orderField eq 'returnTime' ? param.orderDirection : ''}">返回时间</th>
					<th width="4%" orderField="bonus" class="${pageHelper.orderField eq 'bonus' ? param.orderDirection : ''}">技术提成</th>
					<th width="3%" orderField="driver" class="${pageHelper.orderField eq 'driver' ? param.orderDirection : ''}">司机</th>
					<th width="5%" orderField="driverPhone"
						class="${pageHelper.orderField eq 'driverPhone' ? param.orderDirection : ''}">司机电话</th>
					<th width="4%" orderField="cost" class="${pageHelper.orderField eq 'cost' ? param.orderDirection : ''}">送货花费</th>
					<th width="4%" orderField="abstractMonth"
						class="${pageHelper.orderField eq 'abstractMonth' ? param.orderDirection : ''}">所属月份</th>
					<th width="5%" orderField="remarks" class="${pageHelper.orderField eq 'remarks' ? param.orderDirection : ''}">备注</th>
					<%--<th width="4%" orderField="audit" class="${pageHelper.orderField eq 'audit' ? param.orderDirection : ''}">审核人</th>--%>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="item" items="${deliveryList}" varStatus="s">
					<tr target="slt_objId" rel="${item.id }">
						<td>${s.index + 1}</td>
						<td>${item.orderNo}</td>
						<td>${item.orderDate}</td>
						<td>${item.salesman}</td>
						<td>${item.customer}</td>
						<td>${item.product}</td>
						<td>${item.deliveryMethod}</td>
						<td>${item.deliveryDate}</td>
						<td>${item.technician}</td>
						<td>${item.departTime}</td>
						<td>${item.returnTime}</td>
						<td>${item.bonus}</td>
						<td>${item.driver}</td>
						<td>${item.driverPhone}</td>
						<td>${item.cost}</td>
						<td>${item.abstractMonth}</td>
						<td>${item.remarks}</td>
						<%--<td>${item.audit}</td>--%>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<c:import url="/jsp/pager/panelBar.jsp"></c:import>

</div>
